<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib prefix="s"  uri="/struts-tags"%>




<s:if test='PFLAG=="BASIC"'>
<title>申请人基本信息</title><span id="navlink"> 个人客户信息  >> 申请人基本信息</span>
</s:if>
<s:if test='PFLAG=="SPOUSE"'>
<title>申请人配偶基本信息</title><span id="navlink"> 个人客户信息 >> 申请人配偶基本信息</span>
</s:if>
<s:if test='PFLAG=="FAMILY"'>
<title>申请人家庭收支情况</title><span id="navlink"> 个人客户信息  >> 申请人家庭收支情况</span>
</s:if>
<s:if test='PFLAG=="LOAN"'>
<title>申请人贷款情况</title><span id="navlink"> 个人客户信息  >> 申请人贷款情况</span>
</s:if>
 
<script type="text/javascript"src="<%=request.getContextPath()%>/js/custom/personalbasic.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/common/numdiv.js"></script>   <s:if test='#session.eflage=="show"'> <style type="text/css">	select {border:0;-webkit-appearance: none;} </style> </s:if>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/common/money2chinese.js"></script>



<style type="text/css">
.ftab ul li{padding:0 10px;float:left;font-weight:bold;}
.ftab a{color:black}
.ftab a:hover{text-decoration:underline;}
</style>

<script>
  $(function() {
    $( "#accordion" ).accordion({
      collapsible: true
    });
  });
 </script>

<div id="accordion" style="width:auto">
  <h3>客户信息登记</h3>
  <div class="ftab">
    	<ul >
			<li><a href="personalAction!personalread?PFLAG=BASIC">申请人基本信息</a></li>
			<li><a href="personalAction!personalread?PFLAG=SPOUSE">申请人配偶基本信息</a></li>
			<li><a href="personalAction!personalread?PFLAG=FAMILY">申请人家庭收支情况</a></li>
			<li><a href="personalAction!personalread?PFLAG=LOAN">申请人贷款情况</a></li>
			<li><a href="customList!pledgerpersonallist">抵质押清单信息</a>
			<li><a href="upload!filelist?listtype=3">个人客户资料归档目录</a></li>			
		</ul>
  </div>
</div>
<div class="clear"></div>


<div id="msg"></div>
 

<form name="newPersonalBasic" action="personalAction!savePersonalBasic" method="post" id="form">

<tr>
<th><span class="need"></span>客户ID</th>
<td>RF01<input type="text" class="companyid"  readonly="readonly" name="pbasic.id"  id="personalid"  value="${sessionScope.companyid}" /></td>
</tr>


<table id="basic" class="table_box table_all_border" cellspacing="0" cellpadding="0">
<tr>
<th><span class="need"></span>姓名</th>
<td colspan="3"><input type="text" name="pbasic.name" value="${pbasic.name}" /></td>

</tr>

<tr>
<th><span class="need"></span>性别</th>
<td><s:select list="#{1:'男',2:'女'}" name="pbasic.sex" value="pbasic.sex" ></s:select></td>
<th><span class="need"></span>出生年月日</th>
<td><input type="text"class="datepicker"  readonly="readonly" name="pbasic.dateofbirth" value="<s:date name="pbasic.dateofbirth" format="yyyy-MM-dd" />"  /></td>
</tr>
<tr>
<th><span class="need"></span>户籍所在地</th>
<td  colspan="3"><input class="wsv" type="text" name="pbasic.domicile" value="${pbasic.domicile}" /></td>
</tr>
<tr>
<th><span class="need"></span>户籍所在地邮编</th>
<td><input type="text" name="pbasic.domicilezipcode" value="${pbasic.domicilezipcode}" /></td>
<th><span class="need"></span>婚姻状况</th>
<td><s:select list="#{1:'已婚',2:'未婚',3:'其他'}" name="pbasic.maritalstatus" value="pbasic.maritalstatus" headerKey="00" headerValue="---请选择---"></s:select></td>

</tr>

<tr>
<th><span class="need"></span>现居住地址</th>
<td colspan="3"><input class="wsv" type="text" name="pbasic.currentresidentialaddress" value="${pbasic.currentresidentialaddress}" /></td>
</tr>

<tr>
<th><span class="need"></span>现居住地址邮编</th>
<td><input type="text" name="pbasic.residentialrezipcode" value="${pbasic.residentialrezipcode}" /></td>
<th><span class="need"></span>证件类型</th>
<td><select name="pbasic.certificatetype" id="ddit_id"></select></td>
</tr>
<tr>
<th><span class="need"></span>证件号码</th>
<td><input type="text" name="pbasic.certificatenumber" value="${pbasic.certificatenumber}" /></td>
<th><span class="need"></span>文化程度</th>
<td><select name="pbasic.culturaldegree" id="ddcd_id"></select></td>
</tr>
<tr>
<th><span class="need"></span>现有住房来源</th>
<td colspan="3"> <input type="radio" name="pbasic.househascredit" value="1" <s:if test='pbasic.househascredit=="1"'>checked="checked"</s:if> /> 自有有贷   <input type="text" name="pbasic.hhcn" value="${pbasic.hhcn }" />平方米
 				<input type="radio" name="pbasic.househascredit" value="2" <s:if test='pbasic.househascredit=="2"'>checked="checked"</s:if> /> 自有无贷   <input type="text" name="pbasic.hncn" value="${pbasic.hncn }" />平方米
 				<input type="radio" name="pbasic.househascredit" value="3" <s:if test='pbasic.househascredit=="3"'>checked="checked"</s:if> /> 单位宿舍、与父母同住&nbsp;
 				  租住:月租金<input type="text" name="pbasic.housegrental" value="${pbasic.housegrental }" />元
 				<input type="radio" name="pbasic.househascredit" value="4" <s:if test='pbasic.househascredit=="4"'>checked="checked"</s:if> /> 其他
 </td>
</tr>

<tr>
<th><span class="need"></span>工作单位</th>
<td colspan="3"><input class="wsv" type="text" name="pbasic.workunit" value="${pbasic.workunit}" /></td>
</tr>
<tr>
<th><span class="need"></span>单位电话</th>
<td><input type="text" name="pbasic.unittelephone" value="${pbasic.unittelephone}" /></td>
<th><span class="need"></span>现单位工作年限</th>
<td><input type="text" name="pbasic.workingyearsnow" value="${pbasic.workingyearsnow}" />年</td>
</tr>
<tr>
<th><span class="need"></span>前单位工作年限</th>
<td><input type="text" name="pbasic.workingyearsago" value="${pbasic.workingyearsago}" />年</td>
<th><span class="need"></span>职务</th>
<td><input type="text" name="pbasic.post" value="${pbasic.post }" /></td>
</tr>
<tr>
<th><span class="need"></span>所投资或经营企业名称</th>
<td><input type="text" name="pbasic.theinvestmentorbusinessenterprisename" value="${pbasic.theinvestmentorbusinessenterprisename}" /></td>
<th><span class="need"></span>持股比例</th>
<td><input type="text" name="pbasic.shareholdingratio" value="${pbasic.shareholdingratio}" />%</td>
</tr>
<tr>
<th><span class="need"></span>本行业和相近行业经营年限</th>
<td><input type="text" name="pbasic.industryandsimilaroperatinglifeb" value="${pbasic.industryandsimilaroperatinglifeb}" />年</td>
<th><span class="need"></span>单位地址</th>
<td><input class="wsv" type="text" name="pbasic.unitaddress" value="${pbasic.unitaddress}" /></td>
</tr>
<tr>
<th><span class="need"></span>单位邮编</th>
<td><input type="text" name="pbasic.unitzipcode" value="${pbasic.unitzipcode}" /></td>
<th><span class="need"></span>通信地址</th>
<td><input class="wsv" type="text" name="pbasic.mailingaddress" value="${pbasic.mailingaddress}" /></td>
</tr>
<tr>
<th><span class="need"></span>电子邮件</th>
<td><input type="text" name="pbasic.emailb" value="${pbasic.emailb}" /></td>
<th><span class="need"></span>邮编</th>
<td><input type="text" name="pbasic.zipcode" value="${pbasic.zipcode}" /></td>
</tr>
<tr>
<th><span class="need"></span>家庭电话</th>
<td><input type="text" name="pbasic.homephone" value="${pbasic.homephone}" /></td>
<th><span class="need"></span>手机</th>
<td><input type="text" name="pbasic.mobilephone" value="${pbasic.mobilephone}" /></td>
</tr>
<tr>
<th><span class="need"></span>本笔贷款有无其他申请人</th>
<td><s:select list="#{1:'有',2:'无'}" name="pbasic.otherapplicants" value="pbasic.otherapplicants" headerKey="0" headerValue="---请选择---"></s:select></td>
<th><span class="need"></span>其他共同申请人姓名</th>
<td><input type="text" name="pbasic.othercommonnameofapplicant" value="${pbasic.othercommonnameofapplicant}" /></td>
</tr>
<tr>
<th><span class="need"></span>与申请人关系</th>
<td><select name="pbasic.relationshipwithapplicant" id="dd15a" ></select> </td>


</tr>


<tr>
<th><span class="need"></span>付款银行行名称</th>
<td><input class="wsv" type="text" name="pbasic.draweebank" value="${pbasic.draweebank}" /></td>
<th><span class="need"></span>付款银行账号</th>
<td><input type="text"  name="pbasic.draweebankid" value="${pbasic.draweebankid }" /></td>
</tr>

</div>

</table>

<br/>
<br/>
<table class="table_box table_all_border" id="bankInfor">
<tr>
	<th colspan="4">银行基本开户信息</th><th><input type="button" value="增加" id="addBank"/></th>
</tr>
<s:iterator value="lcbankList" status="index" var="var">
	<tr>
		<th><span class="need"></span>本币基本开户银行</th>
		<td><s:textfield name="basicbank" value="%{bankname}"/></td>
		<th><span class="need"></span>本币基本存款账号</th>
		<td><s:textfield name="basicdepositbank" value="%{saveaccount}"/></td>
		<th style="width:10%"><input type="button" value="删除" onClick="getDel(this)"/></th>
	</tr>
</s:iterator>
</table>


<!-- ===================================== -->
<table id="spouse" class="table_box table_all_border" cellspacing="0" cellpadding="0">
<tr>
<th><span class="need"></span>姓名</th>
<td><input type="text" name="pbasic.nameofspouse" value="${pbasic.nameofspouse}" /></td>
</tr>
<tr>
<th><span class="need"></span>性别</th>
<td><s:select list="#{1:'男',2:'女'}" name="pbasic.sexb" value="pbasic.sexb" ></s:select></td>
<th><span class="need"></span>电话</th>
<td><input type="text" name="pbasic.telephone" value="${pbasic.telephone}" /></td>
</tr>
<tr>
<th><span class="need"></span>户籍所在地</th>
<td><input class="wsv" type="text" name="pbasic.domicileb" value="${pbasic.domicileb}" /></td>
<th><span class="need"></span>本地居住年限</th>
<td><input type="text" name="pbasic.localresidence" value="${pbasic.localresidence}" />年</td>
</tr>
<tr>
<th><span class="need"></span>证件类型</th>
<td><select name="pbasic.certificatetypeb" id="dditb_id"></select></td>
<th><span class="need"></span>证件号码</th>
<td><input type="text" name="pbasic.certificatenumberb" value="${pbasic.certificatenumberb}" /></td>
</tr>
<tr>
<th><span class="need"></span>文化程度</th>
<td><select name="pbasic.culturaldegreeb" id="ddcdb_id"></select></td>
<th><span class="need"></span>工作单位</th>
<td><input class="wsv" type="text" name="pbasic.workunitb" value="${pbasic.workunitb}" /></td>
</tr>
<tr>
<th><span class="need"></span>电子邮件</th>
<td><input type="text" name="pbasic.email" value="${pbasic.email}" /></td>
<th><span class="need"></span>单位电话</th>
<td><input type="text" name="pbasic.unittelephoneb" value="${pbasic.unittelephoneb}" /></td>
</tr>
<tr>
<th><span class="need"></span>现单位工作年限</th>
<td><input type="text" name="pbasic.workingyearsnowb" value="${pbasic.workingyearsnowb}" /></td>
<th><span class="need"></span>前单位工作年限</th>
<td><input type="text" name="pbasic.workingyearsagob" value="${pbasic.workingyearsagob}" /></td>
</tr>
<tr>
<th><span class="need"></span>职务</th>
<td><input type="text" name="pbasic.postb" value="${pbasic.postb }" /></td>
<th><span class="need"></span>所投资或经营企业名称</th>
<td><input class="wsv" type="text" name="pbasic.theinvestmentorbusinessenterprisenameb" value="${pbasic.theinvestmentorbusinessenterprisenameb}" /></td>
</tr>
<tr>
<th><span class="need"></span>持股比例</th>
<td><input type="text" name="pbasic.shareholdingratiob" value="${pbasic.shareholdingratiob}" />%</td>
<th><span class="need"></span>本行业和相近行业经营年限</th>
<td><input type="text" name="pbasic.industryandsimilaroperatinglife" value="${pbasic.industryandsimilaroperatinglife}" />年</td>
</tr>
<tr>
<th><span class="need"></span>单位地址</th>
<td colspan="3"><input class="wsv"  type="text" name="pbasic.unitaddressb" value="${pbasic.unitaddressb}" /></td>

</tr>
<tr>
<th><span class="need"></span>邮编</th>
<td><input type="text" name="pbasic.zipcodeb" value="${pbasic.zipcodeb}" /></td>
<th><span class="need"></span>手机</th>
<td><input type="text" name="pbasic.mobilephoneb" value="${pbasic.mobilephoneb}" /></td>
</tr>

</div>
<!--   =================================== -->
</table>
<table id="family"  class="table_box table_all_border" cellspacing="0" cellpadding="0">
<tr>
<th><span class="need"></span>家庭月总收入</th>
<td colspan="3"><input type="text" name="pbasic.totalfamilyincome" value="${pbasic.totalfamilyincome}" class="numdiv" />元</td>
</tr>


<tr>
<th><span class="need"></span>申请人月薪金收入</th>
<td><input type="text" name="pbasic.applicantsalaryincome" class="numdiv" value="${pbasic.applicantsalaryincome}" />元</td>
<th><span class="need"></span>家庭供养人口</th>
<td><input type="text" name="pbasic.familydependents" value="${pbasic.familydependents}" />个</td>
</tr>
<tr>
<th><span class="need"></span>月经营性收入</th>
<td><input type="text" name="pbasic.monthlyoperatingincomeb" class="numdiv" value="${pbasic.monthlyoperatingincomeb}" />元</td>
<th><span class="need"></span>其他经营月收入</th>
<td><input type="text" name="pbasic.otheroperatingincome" class="numdiv" value="${pbasic.otheroperatingincome}" />元</td>
</tr>
<tr>
<th><span class="need"></span>申请人配偶月薪金收入</th>
<td><input type="text" name="pbasic.spousemonthlyincome" class="numdiv" value="${pbasic.spousemonthlyincome}" />元</td>
<th><span class="need"></span>月经营性收入</th>
<td><input type="text" name="pbasic.monthlyoperatingincome" class="numdiv" value="${pbasic.monthlyoperatingincome}" />元</td>
</tr>
<tr>
<th><span class="need"></span>家庭月债务总支出</th>
<td><input type="text" name="pbasic.householddebtexpenditure" class="numdiv"  value="${pbasic.householddebtexpenditure}" />元</td>
<th><span class="need"></span>申请人月还贷款支出</th>
<td><input type="text" name="pbasic.applicantontheloanexpenditure" class="numdiv"  value="${pbasic.applicantontheloanexpenditure}" />元</td>
</tr>
<tr>
<th><span class="need"></span>申请人配偶月还贷款支出</th>
<td><input type="text" name="pbasic.spousemonthlyloanpayments" class="numdiv" value="${pbasic.spousemonthlyloanpayments}" />元</td>
<th><span class="need"></span>家庭对外担保总额</th>
<td><input type="text" name="pbasic.totalamountoffamilyguarantee" class="numdiv"  value="${pbasic.totalamountoffamilyguarantee}" />元</td>
</tr>
</div>
</table>
<!-- ===== -->
<table id="loan"  class="table_box table_all_border" cellspacing="0" cellpadding="0">


<tr>
<th><span class="need"></span>贷款用途</th>
<td><select name="pbasic.useofloans" id="dd16a" ></select> </td>

<th><span class="need"></span>贷款品种</th>
<td><select name="pbasic.loansvarieties" id="dd17a" ></select> </td>

</tr>
<tr>
<th><span class="need"></span>贷款利率</th>
<td><input type="text" name="pbasic.loaninterestrates" value="${pbasic.loaninterestrates}" /></td>
<th><span class="need"></span>贷款期限</th>
<td><input type="text" class="datepicker"  readonly="readonly" name="pbasic.termoftheloan" value="${pbasic.termoftheloan}" /></td>
</tr>
<tr>
<th><span class="need"></span>还款方式</th>
<td><select name="pbasic.wayofrepayment" id="dd18a" ></select> </td>

<th><span class="need"></span>其中保证贷款金额</th>
<td><input type="text" name="pbasic.amountofguaranteeloans" class="numdiv"  value="${pbasic.amountofguaranteeloans}"  />元</td>
</tr>
<tr>
<th><span class="need"></span>信用贷款金额</th>
<td><input type="text" name="pbasic.creditloanamount" class="numdiv"  value="${pbasic.creditloanamount}" />元</td>
<th><span class="need"></span>贷款尚存余额</th>
<td><input type="text" name="pbasic.remainingbalanceofloan" class="numdiv" value="${pbasic.remainingbalanceofloan}" />元</td>
</tr>
<tr>
<th><span class="need"></span>原银行贷款</th>
<td><input type="text" name="pbasic.originalbankloans" class="numdiv" value="${pbasic.originalbankloans}" />元</td>
<th><span class="need"></span>贷款初始金额</th>
<td><input type="text" name="pbasic.initialamountofloan" class="numdiv" value="${pbasic.initialamountofloan}" />元</td>
</tr>
</div>
 
</table>
<div id="button_area">
<div><input type="submit" value="保存"/></div>
	
</form>

<script type="text/javascript">
	$("#basic").hide();
	$("#spouse").hide();
	$("#family").hide();
	$("#loan").hide();
</script>
<s:if test='PFLAG=="BASIC"'>
<script type="text/javascript">
	$("#basic").show();
</script>
</s:if>
<s:if test='PFLAG=="SPOUSE"'>
<script type="text/javascript">
	$("#spouse").show();
	$("#bankInfor").hide();
</script>
</s:if>
<s:if test='PFLAG=="FAMILY"'>
<script type="text/javascript">
	$("#family").show();
	$("#bankInfor").hide();
</script>
</s:if>
<s:if test='PFLAG=="LOAN"'>
<script type="text/javascript">
	$("#loan").show();
	$("#bankInfor").hide();
</script>
</s:if>

 <script type="text/javascript">  
    $(function(){
    	newSelect("ddit_id","findComList?ty=2",${pbasic.certificatetype }0);
    	newSelect("dditb_id","findComList?ty=2",${pbasic.certificatetypeb }0);
    	newSelect("ddcd_id","findComList?ty=7",${pbasic.culturaldegree }0);
    	newSelect("ddcdb_id","findComList?ty=7",${pbasic.culturaldegreeb }0);
    	
    	newSelect("dd15a","findComList?ty=15",${pbasic.relationshipwithapplicant }0);
    	newSelect("dd16a","findComList?ty=16",${pbasic.useofloans }0);
    	newSelect("dd17a","findComList?ty=17",${pbasic.loansvarieties }0);
    	newSelect("dd18a","findComList?ty=18",${pbasic.wayofrepayment }0);
    });
    
    function newSelect(thisid,thisfun,def){
    	var parentid="#"+thisid;
    	var purl = "dropdown!"+ thisfun;
    	appendOption(purl,"",parentid,def);
	}
    function appendOption(thisurl,thisdata,thisid,defaultvalue){
        $.ajax({  
            cache:false,  
            url:thisurl,  
            type:'post',  
            dataType:'json',
            data:thisdata,
          	error: function(XMLHttpRequest, textStatus, errorThrown) {
				//alert(textStatus);
	        },
			success: function(data){
				$(thisid).empty();
				var i;
				var dataLists = eval(data);
				var dataLength=dataLists.length;
				$(thisid).append("<option value='0'>--------------请选择-----------------</option>");
				for (i = 0; i < dataLength; i++) {
					$(thisid).append("<option value='"+dataLists[i].id+"'>"+dataLists[i].name+"</option>");  
				}
				
				$(thisid).val(defaultvalue/10);
			}
    	});
    }
</script>

 <script type="text/javascript">
   function num3du(this){
   var num = this.value;
   
   alert(num);
		num = num+"";
 		var re=/(-?/d+)(/d{3})/
 		while(re.test(num)){
		  num=num.replace(re,"$1,$2")
 		}
 		return num;
	}
	// objvalue=objvalue.replace(/,/gi,'');
 </script>
 
 
 <script type="text/javascript">
<!--
	$("#addBank").click(function(){
			var bankTab = $("#bankInfor");
				bankTab.append("<tr><th><span class='need'></span>本币基本开户银行</th><td><input type='text' name='basicbank' value='' /></td><th><span class='need'></span>本币基本存款账号</th><td><input type='text' name='basicdepositbank' value='' /></td><th style='width:10%''><input type='button' value='删除' onClick='getDel(this)'/></th></tr>"); 
		});
		function getDel(keepInfor){
				$(keepInfor).parent().parent().remove();
				};
//-->
</script>



<input type="hidden" id="eflage" name="eflage" value="${sessionScope.eflage }" />
<script type="text/javascript">
<!--
	$(document).ready(function(){
		if($("#eflage").val() === 'show'){
			$("input[type='text']").prop("readonly", true);
			$("input[type='select']").prop("disabled", true);
			$("input[type='text']").addClass("companyid");
			//$("input[type='select']").addClass("companyid");
			$("#button_area").hide();
			$("#left_area").hide();
			$(".del").hide();
			$(".smodify").html('浏览');
			
		}
	});
//-->
</script>